﻿SeadragonJSRect = function(width, height, tileSize, tileOverlap, minLevel, maxLevel) {
    /// <summary>Creates a TileSource for content of the given width and height, using tiles having the given size and overlap. The minimum and maximum levels for tiles can be supplied, otherwise default values of based on the width and height are used.</summary>
    /// <param name="width"></param>
    /// <param name="height"></param>
    /// <param name="tileSize"></param>
    /// <param name="tileOverlap"></param>
    /// <param name="minLevel"></param>
    /// <param name="maxLevel"></param>
    /// <param name="y"></param>
    /// <field name="aspectRatio" type="Number">The aspect ratio of the content (width/height).</field>
    /// <field name="dimensions" type="SeadragonJSPoint">The natural dimensions of the content (width, height).</field>
    /// <field name="minLevel" type="Number">The minimum level for which tiles exist. The default value is 0.</field>
    /// <field name="maxLevel" type="Number">The maximum level for which tiles exist. The default value is that required to display the content at its natural dimensions.</field>
    /// <field name="tileSize" type="Number">The size of the tiles, in pixels.</field>
    /// <field name="tileOverlap" type="Number">The overlap of the tiles on each edge, in pixels.</field>
    /// <returns type="Object"></returns>
}

SeadragonJSRect.prototype =
{
    aspectRatio: null,
    dimensions: null,
    minLevel: null,
    maxLevel: null,
    tileSize: null,
    tileOverlap: null,

    getLevelScale: function(level) {
        /// <summary>Returns the scale by which all dimensions should be multiplied for the given level. This value increases with the level and is 1 at the default maximum level.</summary>
        /// <param name="level"></param>        
        /// <returns type="Number"></returns>
    },

    getNumTiles: function(level) {
        /// <summary>Returns the number of tiles at the given level in each dimension.</summary>
        /// <param name="level"></param>        
        /// <returns type="Number"></returns>
    },

    getPixelRatio: function(level) {
        /// <summary>Returns the ratio of one pixel to the size of the content at the given level, in both dimensions. For example, at level 0, the ratio is at least 1 in both dimensions, and at the default maximum level, the ratio is exactly the inverse of the content's natural size.</summary>
        /// <param name="level"></param>        
        /// <returns type="Number"></returns>
    },

    getTileAtPoint: function(level, point) {
        /// <summary>Returns the tile at the given level containing the given normalized point. If there is more than one such tile due to tile overlap, returns the most top-left tile.</summary>
        /// <param name="level"></param>        
        /// <returns type="Object"></returns>
    },

    getTileBounds: function(level, x, y) {
        /// <summary>Returns the bounds (position and size) of the given tile in normalized coordinates.</summary>
        /// <param name="level"></param>
        /// <returns type="Object"></returns>
    },

    getTileUrl: function(level, x, y) {
        /// <summary>Returns the URL for the given tile, or null if the URL is not known. Subclasses must override this method.</summary>
        /// <returns type="String"></returns>
    },

    tileExists: function(level, x, y) {
        /// <summary>Returns true if the given tile exists. The default behavior of this method is to simply check that the given tile is within the minimum and maximum levels and the bounds of the given level. Subclasses can override this method for more specific behavior.</summary>
        /// <returns type="Boolean"></returns>
    }
}
